package com.iuie.ns.system.vo.report;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.iuie.ns.frame.utils.StringUtils;

public class ReportInfoVO implements Serializable {

	public static final long serialVersionUID = -1526715378976L;

	private String reportId; // 报表ID

	private String reportCategory; // 报表分类

	private String reportName; // 报表名称

	private String reportJson; // 报表JSON对象

	private String reportDesc; // 描述

	private String reportKey; // 用于前后端访问，unique
	
	private String dataLoader; // 数据加载器
	
	private String className; // 类全路径
	
	private String variableName; // service变量名
	
	private String methodName; // 方法名
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date updateTime; // 更新时间
	
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createTime; // 创建时间

	private Set<ReportParamsVO> reportParams = new HashSet<>();
	
	public String getReportId() {
		return this.reportId;
	}
	public void setReportId(String reportId) {
		this.reportId = reportId;
	}
	public String getReportCategory() {
		return this.reportCategory;
	}
	public void setReportCategory(String reportCategory) {
		this.reportCategory = reportCategory;
	}
	public String getReportName() {
		return this.reportName;
	}
	public void setReportName(String reportName) {
		this.reportName = reportName;
	}
	public String getReportJson() {
		return this.reportJson;
	}
	public void setReportJson(String reportJson) {
		this.reportJson = reportJson;
	}
	public String getReportDesc() {
		return this.reportDesc;
	}
	public void setReportDesc(String reportDesc) {
		this.reportDesc = reportDesc;
	}
	public String getReportKey() {
		return this.reportKey;
	}
	public void setReportKey(String reportKey) {
		this.reportKey = reportKey;
	}
	public Set<ReportParamsVO> getReportParams() {
		return reportParams;
	}
	public void setReportParams(Set<ReportParamsVO> reportParams) {
		this.reportParams = reportParams;
	}
	public String getDataLoader() {
		return this.className + ":" + this.variableName + ":" + this.methodName;
	}
	public void setDataLoader(String dataLoader) {
		this.dataLoader = dataLoader;
		if (StringUtils.isNotBlank(this.dataLoader)) {
			String[] arr = this.dataLoader.split(":");
			if (arr == null || arr.length != 3) {
				return ;
			}
			this.className = arr[0];
			this.variableName = arr[1];
			this.methodName = arr[2];
		}
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public String getVariableName() {
		return variableName;
	}
	public void setVariableName(String variableName) {
		this.variableName = variableName;
	}
	public String getMethodName() {
		return methodName;
	}
	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
}